package com.zp.testpractice.learnTest.dagger;

import com.zp.testpractice.learnTest.mockito.PasswordValidator;

/**
 * @author izp on 2017/11/11.
 */

public class DaggerPresenter {
    private final UserManager mUserManager;
    private final PasswordValidator mPasswordValidator;

    public DaggerPresenter(UserManager userManager, PasswordValidator passwordValidator) {
        this.mUserManager = userManager;
        this.mPasswordValidator = passwordValidator;
    }

    public void login(String username, String password) {
        if (username == null || username.length() == 0) {
            return;
        }
        if (!mPasswordValidator.verifyPassword(password)) {
            return;
        }

        mUserManager.performLogin(username, password);
    }

    public boolean isLoggedIn() {
        return false;
    }
}
